package controlSoftware.DataProcess;

/**
 * Velocity calculation
 */
public class Velocity {
	private double x;
	private double y;
	
	public double getVel_x() {
		return this.x;
	}
	public void setVel_x(double value) {
		this.x = value;
	}
	
	public double getVel_y() {
		return this.y;
	}
	public void setVel_y(double value) {
		this.y = value;
	}
	
	// constructor for velocity object
	public Velocity (double x, double y)
	{
		this.x = x;
		this.y = y;
	}
	
	/**
	 * Calculates the new absolute velocity from previous velocity and acceleration over a period of time
	 * @param prevV
	 * @param accel
	 * @param time
	 * @return
	 */
	public double calcNewVelocity (double prevV, double accel, double time)
	{
		// V = Vo[m/s] + a[m/ss]t[ms]/1000
		return prevV + accel*time/1000;
	}
}
